import request from '@/utils/request'

// 查询仓库列表
export function listStore(query) {
  return request({
    url: '/wms/store/list',
    method: 'get',
    params: query
  })
}

// 查询部门列表（排除节点）
export function listStoreExcludeChild(id) {
  return request({
    url: '/wms/store/list/exclude/' + id,
    method: 'get'
  })
}

export function storeTreeselect(data) {
  return request({
    url: '/wms/store/treeselect',
    method: 'get',
    params: data
  })
}
export function storeTreeselectV2(data) {
  return request({
    url: '/wms/store/treeselectV2',
    method: 'get',
    params: data
  })
}
// 初始化
export function initBean() {
    return request({
        url: '/wms/store/initBean',
        method: 'post'
    })
}

// 查询仓库详细
export function getStore(id) {
  return request({
    url: '/wms/store/' + id,
    method: 'get'
  })
}

// 新增仓库
export function addStore(data) {
  return request({
    url: '/wms/store',
    method: 'post',
    data: data
  })
}

// 修改仓库
export function updateStore(data) {
  return request({
    url: '/wms/store',
    method: 'put',
    data: data
  })
}

// 删除仓库
export function delStore(id) {
  return request({
    url: '/wms/store/' + id,
    method: 'delete'
  })
}
